From: Keir Fraser Date: Tue, 7 Apr 2009 09:14:35 +0000 (+0100) Subject: xend: fix leak of /local/domain/* in xenstore X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~13988^2~25 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=94bacaf76d0c10ec1a56ad34ddaece7e981a3ce8;p=xen.git xend: fix leak of /local/domain/* in xenstore xenwatch thread _storeChanged() may create /local/domain/ entries in xenstore even after the domain has shutdown. Signed-off-by: Kouya Shimura --- diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index 644831b87d..17ed7dac11 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -1634,7 +1634,13 @@ class XendDomainInfo: if changed: # Update the domain section of the store, as this contains some # parameters derived from the VM configuration. - self._storeDomDetails() + self.refresh_shutdown_lock.acquire() + try: + state = self._stateGet() + if state not in (DOM_STATE_SHUTDOWN, DOM_STATE_HALTED,): + self._storeDomDetails() + finally: + self.refresh_shutdown_lock.release() return 1